package cn.kgc.service.impl;

import cn.kgc.mapper.User_infoMapper;
import cn.kgc.pojo.User_info;
import cn.kgc.service.User_infoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class User_infoServiceImpl implements User_infoService {

    @Autowired
    private User_infoMapper userMapper;

    @Override
    public User_info getUserByNameAndPsw(User_info param) {
        User_info user_info= userMapper.getUserByNameAndPsw(param);
        return user_info;
    }

    @Override
    public boolean checkUserId(String username) {
        User_info user1 =  userMapper.selectByName(username);
        System.out.println(username+user1);
        if(user1==null)
            return  false;
        return  true;
    }

    @Override
    public String getPass(String username) {
        User_info user_info=userMapper.selectByName(username);
        return user_info.getPassword();
    }
}
